import request from '@/utils/request';

// 查询模型基本信息列表
export function listBasicInfo(query) {
  return request({
    url: '/model/basicInfo/list',
    method: 'get',
    params: query
  })
}

export function listBasicInfoCollect(query){
  return request({
    url: '/model/basicInfo/collect/list',
    method: 'get',
    params: query
  })
}

// 查询模型基本信息详细
export function getBasicInfo(id) {
  return request({
    url: '/model/basicInfo/' + id,
    method: 'get'
  })
}

// 新增模型基本信息
export function addBasicInfo(data) {
  return request({
    url: '/model/basicInfo',
    method: 'post',
    data: data
  })
}

// 修改模型基本信息
export function updateBasicInfo(data) {
  return request({
    url: '/model/basicInfo',
    method: 'put',
    data: data
  })
}

// 删除模型基本信息
export function delBasicInfo(id) {
  return request({
    url: '/model/basicInfo/' + id,
    method: 'delete'
  })
}

// 发布申请
export function publishApply(id){
  return request({
    url: '/model/basicInfo/publish/' + id,
    method: 'get'
  })
}

//首页模型列表
export function listBasicInfoForIndex(query = {}){
  return request({
    url: '/model/basicInfo/index/list',
    method: 'get',
    params:query
  })
}

//首页模型推荐列表
export function listRecommendForIndex(query = {}){
  return request({
    url: '/model/basicInfo/index/recommend/list',
    method: 'get',
    params: query
  })
}

export function getBasicInfoForIndex(id) {
  return request({
    url: '/model/basicInfo/index/' + id,
    method: 'get'
  })
}

export function recommendModel(id){
  return request({
    url: '/model/basicInfo/recommend/' + id,
    method: 'get'
  })
}

// 模型详情信息里的模型推荐 (同一个分类下)
export function listRecommendForModelDetail(id){
  return request({
    url: '/model/basicInfo/recommend/list/' + id,
    method: 'get'
  })
}
